package com.matt.domain.record;

import com.matt.commons.model.Model;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.util.Date;

/**
 * *******************************
 * Created by Ron.
 * form com.matt
 * on 2017/8/4
 * *******************************
 */
@Entity
@Data
@Table(name = "login_record")
@EqualsAndHashCode(callSuper = true)
public class LoginRecord extends Model{

    @Column
    private Integer loginChannel;

    @Column
    private String loginIp;

    @Column
    private String staffId;

    @Column
    private Date created;

    public static LoginRecord of(Integer loginChannel, String loginIp, String staffId, Date created){
        LoginRecord record = new LoginRecord();
        record.setLoginChannel(loginChannel);
        record.setLoginIp(loginIp);
        record.setStaffId(staffId);
        record.setCreated(created);
        return record;

    }
}
